From 7ba4e28655b40121d199a41134dc9f7bdc4b0933 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bartosz=20Dziewo=C5=84ski?= Date: Tue, 28 Jun 2016 21:32:43 +0200 Subject: [PATCH] Deprecate the 'UploadVerification' hook It has been replaced by 'UploadVerifyFile' a long time ago, but never officially deprecated. Change-Id: I345dca48c28ee5e1e2ad35bb6f42bbc03a1f4dd1 --- RELEASE-NOTES-1.28 | 1 + docs/hooks.txt | 4 ++-- includes/upload/UploadBase.php | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/RELEASE-NOTES-1.28 b/RELEASE-NOTES-1.28 index 4c075fc66c..d0bb57f609 100644 --- a/RELEASE-NOTES-1.28 +++ b/RELEASE-NOTES-1.28 @@ -54,6 +54,7 @@ changes to languages because of Phabricator reports. * [BREAKING CHANGE] $wgExtendedLoginCookies has been removed. You can use or update a custom session provider if needed. * Deprecated APIEditBeforeSave hook in favor of EditFilterMergedContent. +* The 'UploadVerification' hook is deprecated. Use 'UploadVerifyFile' instead. == Compatibility == diff --git a/docs/hooks.txt b/docs/hooks.txt index c0c01f47a0..8640228c03 100644 --- a/docs/hooks.txt +++ b/docs/hooks.txt @@ -3285,8 +3285,8 @@ added to the descriptor &$radio: Boolean, if source type should be shown as radio button $selectedSourceType: The selected source type -'UploadVerification': Additional chances to reject an uploaded file. Consider -using UploadVerifyFile instead. +'UploadVerification': DEPRECATED! Use UploadVerifyFile instead. +Additional chances to reject an uploaded file. $saveName: (string) destination file name $tempName: (string) filesystem path to the temporary file for checks &$error: (string) output: message key for message to show if upload canceled by diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index 5ec49ba6a8..08fbeea1cc 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -353,7 +353,7 @@ abstract class UploadBase { $error = ''; if ( !Hooks::run( 'UploadVerification', - [ $this->mDestName, $this->mTempPath, &$error ] ) + [ $this->mDestName, $this->mTempPath, &$error ], '1.28' ) ) { return [ 'status' => self::HOOK_ABORTED, 'error' => $error ]; } -- 2.20.1